#include <bits/stdc++.h>
using namespace std;
const int N = 10000 + 10;
const double PI = acos(-1.0);
const double eps = 1e-5;
int n, f;
double v[N];
bool check(double x) {
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    ans += floor(v[i] / x);
  }
  return ans >= f + 1;
}
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    cin >> n >> f;
    double maxa = -1;
    for (int i = 0; i < n; ++i) {
      int r;
      cin >> r;
      v[i] = PI * r * r;
      maxa = max(maxa, v[i]);
    }
    double l = 0, r = PI * 10001 * 10001;
    while (r - l > eps) {
      double mid = (l + r) / 2;
      if (check(mid)) {
        l = mid;
      } else {
        r = mid;
      }
    }
    printf("%f\n", l);
  }
}
